using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeoAnalyticsDesktopTools._UseProximity
{
    /// <summary>
    /// <para>Create Buffers</para>
    /// <para>Creates buffers around input features to a specified distance.</para>
    /// <para>在指定距离的输入要素周围创建缓冲区。</para>
    /// </summary>    
    [DisplayName("Create Buffers")]
    public class CreateBuffers : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateBuffers()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_layer">
        /// <para>Input Layer</para>
        /// <para>The point, polyline, or polygon features to be buffered.</para>
        /// <para>要缓冲的点要素、折线要素或面要素。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>A new feature class of buffered results.</para>
        /// <para>缓冲结果的新要素类。</para>
        /// </param>
        /// <param name="_method">
        /// <para>Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the method that will be used to create the buffer.</para>
        ///   <bulletList>
        ///     <bullet_item>Geodesic— Buffers are created using a shape-preserving geodesic buffer method regardless of the input coordinate system. This is the default.</bullet_item><para/>
        ///     <bullet_item>Planar— If the input features are in a projected coordinate system, Euclidean buffers are created. If the input features are in a geographic coordinate system, geodesic buffers are created. The Output Coordinate System environment setting can be used to specify a coordinate system.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于创建缓冲区的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>测地线 - 无论输入坐标系如何，都使用保持形状的测地线缓冲区方法创建缓冲区。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>平面 - 如果输入要素位于投影坐标系中，则创建欧几里得缓冲区。如果输入要素位于地理坐标系中，则会创建测地线缓冲区。输出坐标系环境设置可用于指定坐标系。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_buffer_type">
        /// <para>Buffer Type</para>
        /// <para><xdoc>
        ///   <para>Specifies how the buffer distance will be defined.</para>
        ///   <bulletList>
        ///     <bullet_item>Distance—Apply the same linear distance to all features.</bullet_item><para/>
        ///     <bullet_item>Field—Select a numeric or string field to represent the buffer distance.</bullet_item><para/>
        ///     <bullet_item>Expression—Build an equation using fields, constants, and mathematical operations to represent the buffer distance.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何定义缓冲区距离。</para>
        ///   <bulletList>
        ///     <bullet_item>距离 - 将相同的线性距离应用于所有要素。</bullet_item><para/>
        ///     <bullet_item>字段 （Field） - 选取一个数字或字符串字段来表示缓冲区距离。</bullet_item><para/>
        ///     <bullet_item>表达式 - 使用字段、常量和数学运算构建方程来表示缓冲区距离。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public CreateBuffers(object _input_layer, object _out_feature_class, _method_value _method, _buffer_type_value _buffer_type)
        {
            this._input_layer = _input_layer;
            this._out_feature_class = _out_feature_class;
            this._method = _method;
            this._buffer_type = _buffer_type;
        }
        public override string ToolboxName => "GeoAnalytics Desktop Tools";

        public override string ToolName => "Create Buffers";

        public override string CallName => "gapro.CreateBuffers";

        public override List<string> AcceptEnvironments => ["extent", "outputCoordinateSystem", "parallelProcessingFactor", "workspace"];

        public override object[] ParameterInfo => [_input_layer, _out_feature_class, _method.GetGPValue(), _buffer_type.GetGPValue(), _buffer_field, _buffer_distance, _buffer_expression, _dissolve_option.GetGPValue(), _dissolve_fields, _summary_fields, _multipart.GetGPValue()];

        /// <summary>
        /// <para>Input Layer</para>
        /// <para>The point, polyline, or polygon features to be buffered.</para>
        /// <para>要缓冲的点要素、折线要素或面要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_layer { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>A new feature class of buffered results.</para>
        /// <para>缓冲结果的新要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the method that will be used to create the buffer.</para>
        ///   <bulletList>
        ///     <bullet_item>Geodesic— Buffers are created using a shape-preserving geodesic buffer method regardless of the input coordinate system. This is the default.</bullet_item><para/>
        ///     <bullet_item>Planar— If the input features are in a projected coordinate system, Euclidean buffers are created. If the input features are in a geographic coordinate system, geodesic buffers are created. The Output Coordinate System environment setting can be used to specify a coordinate system.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于创建缓冲区的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>测地线 - 无论输入坐标系如何，都使用保持形状的测地线缓冲区方法创建缓冲区。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>平面 - 如果输入要素位于投影坐标系中，则创建欧几里得缓冲区。如果输入要素位于地理坐标系中，则会创建测地线缓冲区。输出坐标系环境设置可用于指定坐标系。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Method")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _method_value _method { get; set; }

        public enum _method_value
        {
            /// <summary>
            /// <para>Planar</para>
            /// <para>Planar— If the input features are in a projected coordinate system, Euclidean buffers are created. If the input features are in a geographic coordinate system, geodesic buffers are created. The Output Coordinate System environment setting can be used to specify a coordinate system.</para>
            /// <para>平面 - 如果输入要素位于投影坐标系中，则创建欧几里得缓冲区。如果输入要素位于地理坐标系中，则会创建测地线缓冲区。输出坐标系环境设置可用于指定坐标系。</para>
            /// </summary>
            [Description("Planar")]
            [GPEnumValue("PLANAR")]
            _PLANAR,

            /// <summary>
            /// <para>Geodesic</para>
            /// <para>Geodesic— Buffers are created using a shape-preserving geodesic buffer method regardless of the input coordinate system. This is the default.</para>
            /// <para>测地线 - 无论输入坐标系如何，都使用保持形状的测地线缓冲区方法创建缓冲区。这是默认设置。</para>
            /// </summary>
            [Description("Geodesic")]
            [GPEnumValue("GEODESIC")]
            _GEODESIC,

        }

        /// <summary>
        /// <para>Buffer Type</para>
        /// <para><xdoc>
        ///   <para>Specifies how the buffer distance will be defined.</para>
        ///   <bulletList>
        ///     <bullet_item>Distance—Apply the same linear distance to all features.</bullet_item><para/>
        ///     <bullet_item>Field—Select a numeric or string field to represent the buffer distance.</bullet_item><para/>
        ///     <bullet_item>Expression—Build an equation using fields, constants, and mathematical operations to represent the buffer distance.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何定义缓冲区距离。</para>
        ///   <bulletList>
        ///     <bullet_item>距离 - 将相同的线性距离应用于所有要素。</bullet_item><para/>
        ///     <bullet_item>字段 （Field） - 选取一个数字或字符串字段来表示缓冲区距离。</bullet_item><para/>
        ///     <bullet_item>表达式 - 使用字段、常量和数学运算构建方程来表示缓冲区距离。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Buffer Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _buffer_type_value _buffer_type { get; set; }

        public enum _buffer_type_value
        {
            /// <summary>
            /// <para>Distance</para>
            /// <para>Distance—Apply the same linear distance to all features.</para>
            /// <para>距离 - 将相同的线性距离应用于所有要素。</para>
            /// </summary>
            [Description("Distance")]
            [GPEnumValue("DISTANCE")]
            _DISTANCE,

            /// <summary>
            /// <para>Field</para>
            /// <para>Field—Select a numeric or string field to represent the buffer distance.</para>
            /// <para>字段 （Field） - 选取一个数字或字符串字段来表示缓冲区距离。</para>
            /// </summary>
            [Description("Field")]
            [GPEnumValue("FIELD")]
            _FIELD,

            /// <summary>
            /// <para>Expression</para>
            /// <para>Expression—Build an equation using fields, constants, and mathematical operations to represent the buffer distance.</para>
            /// <para>表达式 - 使用字段、常量和数学运算构建方程来表示缓冲区距离。</para>
            /// </summary>
            [Description("Expression")]
            [GPEnumValue("EXPRESSION")]
            _EXPRESSION,

        }

        /// <summary>
        /// <para>Buffer Field</para>
        /// <para>The field that contains the buffer distance for each feature. If a field value is a number, it is assumed that the distance is in the linear unit of the Input Layer spatial reference, unless the Input Layer is in a geographic coordinate system, in which case, the value is assumed to be in meters. If the linear unit specified in the field values is invalid or not recognized, the linear unit of the input features' spatial reference will be used by default.</para>
        /// <para>包含每个要素的缓冲距离的字段。如果字段值为数字，则假定距离为输入图层空间参考的线性单位，除非输入图层位于地理坐标系中，在这种情况下，假定该值以米为单位。如果字段值中指定的线性单位无效或无法识别，则默认情况下将使用输入要素空间参考的线性单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Buffer Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _buffer_field { get; set; } = null;


        /// <summary>
        /// <para>Buffer Distance</para>
        /// <para>The distance around the input features that will be buffered. Distance can be expressed in meters, kilometers, feet, yards, miles, or nautical miles.</para>
        /// <para>将缓冲的输入要素周围的距离。距离可以用米、公里、英尺、码、英里或海里表示。</para>
        /// <para>单位： Feet | Yards | Miles | NauticalMiles | Meters | Kilometers </para>
        /// </summary>
        [DisplayName("Buffer Distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _buffer_distance { get; set; } = null;


        /// <summary>
        /// <para>Buffer Expression</para>
        /// <para><xdoc>
        ///   <para>An equation using fields and mathematical operators that will be applied as a buffer to each feature. Fields must be numeric, and the expression can include [+ - * / ] operators and multiple fields. Calculated values are applied in meters unless otherwise specified. For example, apply a buffer that multiples a numeric field named distance in kilometers by 2 and adds 15 meters.</para>
        ///   <para>Use an Arcade expression such as as_kilometers($feature["distance"]) * 2 + as_meters(15).</para>
        ///   <para>If the layer is added to the map, the Fields and Helpers filters can be used to build an expression.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>使用字段和数学运算符的方程，将作为缓冲区应用于每个要素。字段必须是数字，表达式可以包括 [+ - * / ] 运算符和多个字段。除非另有说明，否则计算值以米为单位。例如，应用一个缓冲区，将名为“公里”的数值字段乘以 2，然后加上 15 米。</para>
        ///   <para>使用 Arcade 表达式，例如 as_kilometers（$feature[“distance”]） * 2 + as_meters（15）。</para>
        ///   <para>如果将图层添加到地图中，则可以使用字段和帮助程序过滤器来构建表达式。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Buffer Expression")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _buffer_expression { get; set; } = null;


        /// <summary>
        /// <para>Dissolve Option</para>
        /// <para><xdoc>
        ///   <para>Specifies the dissolve option that will be used to remove buffer overlap.</para>
        ///   <bulletList>
        ///     <bullet_item>None—An individual buffer for each feature will be maintained regardless of overlap. This is the default.</bullet_item><para/>
        ///     <bullet_item>All—All buffers will be dissolved together into a single feature, removing any overlap.</bullet_item><para/>
        ///     <bullet_item>List—Any buffers sharing attribute values in the listed fields (carried over from the input features) will be dissolved.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于删除缓冲区重叠的溶解选项。</para>
        ///   <bulletList>
        ///     <bullet_item>无 - 无论是否重叠，都将保留每个要素的单独缓冲区。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>全部 - 所有缓冲区将一起融合为单个特征，从而消除任何重叠。</bullet_item><para/>
        ///     <bullet_item>列表—将溶解所列字段中共享属性值的任何缓冲区（从输入要素延续而来）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dissolve Option")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _dissolve_option_value _dissolve_option { get; set; } = _dissolve_option_value._NONE;

        public enum _dissolve_option_value
        {
            /// <summary>
            /// <para>None</para>
            /// <para>None—An individual buffer for each feature will be maintained regardless of overlap. This is the default.</para>
            /// <para>无 - 无论是否重叠，都将保留每个要素的单独缓冲区。这是默认设置。</para>
            /// </summary>
            [Description("None")]
            [GPEnumValue("NONE")]
            _NONE,

            /// <summary>
            /// <para>All</para>
            /// <para>All—All buffers will be dissolved together into a single feature, removing any overlap.</para>
            /// <para>全部 - 所有缓冲区将一起融合为单个特征，从而消除任何重叠。</para>
            /// </summary>
            [Description("All")]
            [GPEnumValue("ALL")]
            _ALL,

            /// <summary>
            /// <para>List</para>
            /// <para>List—Any buffers sharing attribute values in the listed fields (carried over from the input features) will be dissolved.</para>
            /// <para>列表—将溶解所列字段中共享属性值的任何缓冲区（从输入要素延续而来）。</para>
            /// </summary>
            [Description("List")]
            [GPEnumValue("LIST")]
            _LIST,

        }

        /// <summary>
        /// <para>Dissolve Fields</para>
        /// <para>A list of one or more fields from the input features on which output buffers will be dissolved. Any buffers sharing attribute values in the listed fields will be dissolved. This option is only required when Dissolve Option is List.</para>
        /// <para>输入要素中的一个或多个字段的列表，输出缓冲区将在其上溶解。在列出的字段中共享属性值的任何缓冲区都将被解散。仅当“溶解选项”为“列表”时，才需要此选项。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dissolve Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _dissolve_fields { get; set; } = null;


        /// <summary>
        /// <para>Summary Fields</para>
        /// <para><xdoc>
        ///   <para>Specifies statistics that can be applied to numeric and string fields. If left empty, only count will be calculated. These statistics are only applied when Dissolve Option is List or All.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Count—The number of nonnull values. It can be used on numeric fields or strings. The count of [null, 0, 2] is 2.</bullet_item><para/>
        ///       <bullet_item>Sum—The sum of numeric values in a field. The sum of [null, null, 3] is 3.</bullet_item><para/>
        ///       <bullet_item>Mean—The mean of numeric values. The mean of [0, 2, null] is 1.</bullet_item><para/>
        ///       <bullet_item>Min—The minimum value of a numeric field. The minimum of [0, 2, null] is 0.</bullet_item><para/>
        ///       <bullet_item>Max—The maximum value of a numeric field. The maximum value of [0, 2, null] is 2.</bullet_item><para/>
        ///       <bullet_item>Standard Deviation—The standard deviation of a numeric field. The standard deviation of [1] is null. The standard deviation of [null, 1,1,1] is null.</bullet_item><para/>
        ///       <bullet_item>Variance—The variance of a numeric field in a track. The variance of [1] is null. The variance of [null, 1, 1, 1] is null.</bullet_item><para/>
        ///       <bullet_item>Range—The range of a numeric field. This is calculated as the minimum value subtracted from the maximum value. The range of [0, null, 1] is 1. The range of [null, 4] is 0.</bullet_item><para/>
        ///       <bullet_item>Any—A sample string from a field of type string.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定可应用于数值和字符串字段的统计信息。如果留空，则仅计算计数。仅当“溶解选项”为“列表”或“全部”时，才应用这些统计信息。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>计数 - 非空值的数目。它可以用于数值字段或字符串。[null， 0， 2] 的计数为 2。</bullet_item><para/>
        ///       <bullet_item>总和 - 字段中数值的总和。[null， null， 3] 的总和为 3。</bullet_item><para/>
        ///       <bullet_item>均值 - 数值的平均值。[0， 2， null] 的平均值为 1。</bullet_item><para/>
        ///       <bullet_item>最小值 - 数值字段的最小值。[0， 2， null] 的最小值为 0。</bullet_item><para/>
        ///       <bullet_item>最大值 - 数值字段的最大值。[0， 2， null] 的最大值为 2。</bullet_item><para/>
        ///       <bullet_item>标准差 - 数值字段的标准差。[1] 的标准差为空。[null， 1,1,1] 的标准差为 null。</bullet_item><para/>
        ///       <bullet_item>方差 - 轨迹中数值字段的方差。[1] 的方差为 null。[null， 1， 1， 1] 的方差为 null。</bullet_item><para/>
        ///       <bullet_item>范围 - 数值字段的范围。这是通过从最大值中减去最小值来计算的。[0， null， 1] 的范围为 1。[null， 4] 的范围为 0。</bullet_item><para/>
        ///       <bullet_item>任意 - 字符串类型字段中的示例字符串。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Summary Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _summary_fields { get; set; } = null;


        /// <summary>
        /// <para>Multipart</para>
        /// <para><xdoc>
        ///   <para>Specifies whether multipart features will be created.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Output multipart features will be created where appropriate.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Instead of creating multipart features, individual features will be created for each part. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否创建分段要素。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将在适当位置创建输出多部分要素。</bullet_item><para/>
        ///     <bullet_item>未选中 - 将为每个零件创建单独的特征，而不是创建多零件特征。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Multipart")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _multipart_value _multipart { get; set; } = _multipart_value._false;

        public enum _multipart_value
        {
            /// <summary>
            /// <para>MULTI_PART</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("MULTI_PART")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>SINGLE_PART</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SINGLE_PART")]
            [GPEnumValue("false")]
            _false,

        }

        public CreateBuffers SetEnv(object extent = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object workspace = null)
        {
            base.SetEnv(extent: extent, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, workspace: workspace);
            return this;
        }

    }

}